<template>
	<div style="padding:30px;">
		<el-form :model="dialogForm">
		<el-card class="box-card">
		  <div slot="header" class="clearfix">
		    <span style="line-height: 30px;">上游供应商信息</span>
		  </div>
		  <div  class="text item">
			
			  	<el-form-item label="供应商名称" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.qcsl" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="提车地址(启运地)" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.qckx" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="提车联系人" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.qcys" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="联系人手机号" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.zdj_pz" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			</div>
		</el-card>
		<el-card class="box-card" style="margin-top:15px;">
		  <div slot="header" class="clearfix">
		    <span style="line-height: 30px;">物流信息</span>
		  </div>
		  <div  class="text item">
			  	<el-form-item label="物流公司" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.qcsl" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="验车司机信息" :label-width="formLabelWidth">
			      <el-input type="textarea" v-model="dialogForm.qczjg" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="目的地" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.qcys" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="物流费" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.zdj_pz" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="放空费" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.qczjg" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="预计验车时间(小时)" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.dzje" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="预计运输时间(天)" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.qcsl" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			    <el-form-item label="公里数" :label-width="formLabelWidth">
			      <el-input v-model="dialogForm.qckx" auto-complete="off" :disabled="isAdd"></el-input>
			    </el-form-item>
			</div>
		</el-card>
		<el-card class="box-card" style="margin-top:15px;">
		  <div slot="header" class="clearfix">
		    <span style="line-height: 30px;">确认备注</span>
		  </div>
		  <div  class="text item">
		  	<el-form-item label="确认备注" :label-width="formLabelWidth">
		      <el-input type="textarea" v-model="dialogForm.qczjg" auto-complete="off" :disabled="isAdd"></el-input>
		    </el-form-item>
		  </div>
		</el-card>
		<div style="text-align:right;margin-top:15px;">
			 <el-button @click="returnBack">返 回</el-button>
			 <el-button v-if="!isAdd" type="primary" @click="submitConfirmForm('dialogForm')">提 交</el-button>
		</div>
		</el-form>
	</div>
</template>
<script>
    import router from '@/router';
	export default{
		/*created:function(){
            eventIsAdd.$on('eventIsAdd', function(val) {console.log(val)})
            this.isAdd=false;
		}, */
		data(){
			
			return{
				isAdd:true,
				formLabelWidth:'170px',
				//弹窗或者查看页面信息
		        dialogForm:{
		          qcsl:"",
		          qckx:"",
		          qcys:"",
		          zdj_pz:"",
		          qczjg:"",
		          dzje:""
		        }
			}
		},methods:{
			returnBack(){
				router.push({ path:`/logistics/logisticsInfo/index`});
			},
			submitConfirmForm(formName){
				//this.isAdd=false;
                this.$refs[formName].validate((valid) => {
		          if (valid) {
		            alert('submit!');
		          } else {
		            console.log('error submit!!');
		            return false;
		          }
		        });
			}
		}
	};
	
</script>